//
//  ChatRoomPushViewController.m
//  E_ChatRoom
//
//  Created by rimi on 15/6/30.
//  Copyright (c) 2015年 TJ. All rights reserved.
//

#import "ChatRoomPushViewController.h"

@interface ChatRoomPushViewController ()

@end

@implementation ChatRoomPushViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = [UIColor whiteColor];
}

#pragma mark - XMPPRoomDelegate methods

- (void)viewWillAppear:(BOOL)animated {
    XMPPTool *xmppTool = [XMPPTool sharedXMPPTool];
    XMPPJID *roomJid = [XMPPJID jidWithString:[NSString stringWithFormat:@"%@@%@",@"222",RoomService]];
    [xmppTool creatChatRoom:roomJid];
    
    XMPPRoom *xmppRoom = xmppTool.chatRoom;
    [xmppRoom addDelegate:self delegateQueue:dispatch_get_main_queue()];
    
    [xmppRoom joinRoomUsingNickname:@"123" history:nil];
}

- (void)xmppRoomDidCreate:(XMPPRoom *)sender {
    TJLog(@"12311111111111111111111");
}

- (void)xmppRoomDidJoin:(XMPPRoom *)sender {
    TJLog(@"asdf");
}

- (void)xmppRoom:(XMPPRoom *)sender didFetchBanList:(NSArray *)items {
    TJLog(@"123");
}

- (void)xmppRoom:(XMPPRoom *)sender didNotFetchBanList:(XMPPIQ *)iqError {
    TJLog(@"sadfadsf");
}

@end
